package org.example.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.example.domain.po.ErpAccountHead;
import org.example.domain.po.ErpDepotHead;
import org.example.service.ErpAccountHeadService;
import org.example.mapper.ErpAccountHeadMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 24059
* @description 针对表【erp_account_head(财务主表)】的数据库操作Service实现
* @createDate 2024-11-25 10:03:55
*/
@Service
public class ErpAccountHeadServiceImpl extends ServiceImpl<ErpAccountHeadMapper, ErpAccountHead>
    implements ErpAccountHeadService{
    public Page<ErpAccountHead> selectByExample(Page<ErpAccountHead> page,
                                                @Param("billNo") String billNo, @Param("billTime") String billTime, @Param("status") String status,
                                                @Param("organId") Long organId, @Param("handsPersonId") Long handsPersonId, @Param("accountId") Long accountId,
                                                @Param("supId") Long supId, @Param("remark") String remark,@Param("username") String username)
        {
            return baseMapper.selectByExample(page, billNo, billTime, status, organId, handsPersonId, accountId, supId, remark,username);
        }

    public boolean update(List<Integer> ids, String status){
        return lambdaUpdate().set(ErpAccountHead::getStatus, status).in(ErpAccountHead::getId, ids).update();


    }
    public List<ErpAccountHead> selectBy(@Param("id")Long id){
        return baseMapper.selectBy(id);
    }
    public List<ErpAccountHead> selectByzc(@Param("type")String type,@Param("id")Long id){
        return baseMapper.selectByzc(type,id);
    }
    public List<ErpAccountHead> selectBysk(@Param("type")String type,@Param("id")Long id){
        return baseMapper.selectBysk(type,id);
    }


    public Page<ErpAccountHead> selectByExamplezc(Page<ErpAccountHead> page,
                                                     @Param("billNo")String billNo, @Param("billTime") String billTime, @Param("status") String status,
                                                     @Param("organId") Long organId, @Param("handsPersonId") Long handsPersonId, @Param("accountId") Long accountId,
                                                     @Param("supId") Long supId, @Param("remark") String remark,@Param("username") String username,@Param("type")String type){
        return baseMapper.selectByExamplezc(page, billNo, billTime, status, organId, handsPersonId, accountId, supId, remark,username,type);
    }
    public Page<ErpAccountHead> selectByExamplesk(Page<ErpAccountHead> page,
                                                   @Param("billNo")String billNo, @Param("billTime") String billTime, @Param("status") String status,
                                                   @Param("organId") Long organId, @Param("handsPersonId") Long handsPersonId, @Param("accountId") Long accountId,
                                                   @Param("supId") Long supId, @Param("remark") String remark,@Param("username") String username,@Param("supName") String supName,@Param("type") String type){
        return baseMapper.selectByExamplesk(page, billNo, billTime, status, organId, handsPersonId, accountId, supId, remark,username,supName,type);
    }
    public Page<ErpAccountHead> selectByExamplezz(Page<ErpAccountHead> page,
                                                    @Param("billNo")String billNo, @Param("billTime") String billTime, @Param("status") String status,
                                                    @Param("organId") Long organId, @Param("handsPersonId") Long handsPersonId, @Param("accountId") Long accountId,
                                                    @Param("supId") Long supId, @Param("remark") String remark,@Param("username") String username,@Param("type")String type){
        return baseMapper.selectByExamplezz(page, billNo, billTime, status, organId, handsPersonId, accountId, supId, remark,username,type);
    }
    public Page<ErpAccountHead> selectByExamplesyfk(Page<ErpAccountHead> page,
                                                  @Param("billNo")String billNo, @Param("billTime") String billTime, @Param("status") String status,
                                                  @Param("organId") Long organId, @Param("handsPersonId") Long handsPersonId, @Param("accountId") Long accountId,
                                                  @Param("supId") Long supId, @Param("remark") String remark,@Param("username") String username,@Param("type")String type){
        return baseMapper.selectByExamplesyfk(page, billNo, billTime, status, organId, handsPersonId, accountId, supId, remark,username,type);
    }
    public List<ErpAccountHead> selectByzz(@Param("type")String type,@Param("id")Long id){
        return baseMapper.selectByzz(type,id);
    }
    public List<ErpAccountHead> selectBysyfk(@Param("id")Long id){
        return baseMapper.selectBysyfk(id);
    }
    public int insertSelective2(ErpAccountHead erpAccountHead){
        return baseMapper.insertSelective2(erpAccountHead);
    }
    public Long finbyid(@Param("billNo")String billNo){
        return baseMapper.finbyid(billNo);
    }
    public int updateby(@Param("erpAccountHead")ErpAccountHead erpAccountHead,@Param("billNo")String billNo){
        return baseMapper.updateby(erpAccountHead,billNo);
    }
    public  Long lookByHeaderId(@Param("biiNo") String biiNo){
        return baseMapper.lookByHeaderId(biiNo);
    }
}




